Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native crypto.randomUUID() instead of hat module #1274

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

varna
Copy link
Contributor

@varna varna commented Aug 15, 2024

Reducing number of dependencies by replacing hat module with native crypto.randomUUID() which is well supported:

https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID#browser_compatibility
https://caniuse.com/mdn-api_crypto_randomuuid

This would push mapbox-gl-draw dev env to node 20 (or deno/bun). Node 18 is reaching end of maintenance next year, so idk if that's an issue for you.

@varna varna requested a review from a team as a code owner August 15, 2024 12:52
@underoot
Copy link
Member

underoot commented Oct 8, 2024

Hello, @varna! Thank you for your contribution! To me, it seems that replacing of hat with crypto.randomUUID() will cause inability to use maps on site without HTTPS. I agree that hat module seems outdated and need to be replaced. Maybe we can consider some another alternatives like nanoid

cc @stepankuzmin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants